package com.busdepot.webapp.domain;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("catalogService")
public class CatalogServiceImpl implements CatalogService {

	@Autowired
	CatalogRepository catalogRepository;

	public List<Category> getCategoryByModelId(int id) {
		return catalogRepository.getCategoryByModelId(id);
	}

	public List<Group> getGroup(int categoryId, int modelId) {
		return catalogRepository.getGroup(categoryId, modelId);
	}

	public int getModelId(String model, int startYear, int endYear) {
		return catalogRepository.getModelId(model, startYear, endYear);
	}

	public List<Model> getModelsByName(String modelName) {
		return catalogRepository.getModelsByName(modelName);
	}

	public List<BusDepotPart> getPartsByCategoryId(int id) {
		return catalogRepository.getPartsByCategoryId(id);
	}

	public List<BusDepotPart> getPartsByGroupId(int id) {
		return catalogRepository.getPartsByGroupId(id);
	}

	public List<BusDepotPart> getPartsByProductGroupId(int id) {
		return catalogRepository.getPartsByProductGroupId(id);
	}

	public List<ProductGroup> getProductGroup(int groupId, int categoryId,
			int modelId) {
		return catalogRepository.getProductGroup(groupId, categoryId, modelId);
	}

}
